package main

import "fmt"

/* [序] 结构体嵌套及字段冲突如何解决*/
func main() {
	p1 := Person{
		Name: "李四",
		Age:  18,
		Address: Address{
			Province:   "新疆",
			City:       "阿克苏",
			UpdateTime: "20200505",
		},
		Email: Email{
			Addr:       "奎星路",
			UpdateTime: "20200808",
		},
	}
	/* [01] 打印原始格式 */
	fmt.Printf("原始格式： %#v\n", p1)
	fmt.Println(p1.Name, p1.Address)
	fmt.Println(p1.Address.UpdateTime, p1.Email.UpdateTime)

}

type Person struct {
	Name    string
	Age     int
	Address Address
	Email   //使用匿名结构体
}
type Address struct {
	Province   string
	City       string
	UpdateTime string
}
type Email struct {
	Addr       string
	UpdateTime string
}
